﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using ViewModels;
using System.Reactive.Linq;
using System.Windows;
using OAuthLib;
using System.Runtime.Serialization;
using RestAPICore;
using Common;
using System.Threading;
using System.Collections.ObjectModel;
using System.Threading.Tasks;


namespace SinaWeiboApp.ViewModels.Login
{
    [DataContract]
    public class AuthToken_Model : ViewModelBase<AuthToken_Model>
    {


        [DataMember]
        public String UserId
        {
            get { return _UserIdContainerLocator(this).Value; }
            set { _UserIdContainerLocator(this).SetValueAndTryNotify(value); }
        }
        #region Property String UserId Setup
        protected PropertyContainer<String> _UserId;
        protected static Func<object, PropertyContainer<String>> _UserIdContainerLocator =
            RegisterContainerLocator<String>(
                "UserId",
                model =>
                    model._UserId =
                        model._UserId
                        ??
                        new PropertyContainer<String>("UserId"));
        #endregion


        public DateTime LastLoginTime
        {
            get { return _LastLoginTimeContainerLocator(this).Value; }
            set { _LastLoginTimeContainerLocator(this).SetValueAndTryNotify(value); }
        }
        #region Property DateTime LastLoginTime Setup
        protected PropertyContainer<DateTime> _LastLoginTime;
        protected static Func<object, PropertyContainer<DateTime>> _LastLoginTimeContainerLocator =
            RegisterContainerLocator<DateTime>(
                "LastLoginTime",
                model =>
                    model._LastLoginTime =
                        model._LastLoginTime
                        ??
                        new PropertyContainer<DateTime>("LastLoginTime"));
        #endregion




        public AuthToken SavedToken
        {
            get { return _SavedTokenContainerLocator(this).Value; }
            set { _SavedTokenContainerLocator(this).SetValueAndTryNotify(value); }
        }
        #region Property AuthToken SavedToken Setup
        protected PropertyContainer<AuthToken> _SavedToken;
        protected static Func<object, PropertyContainer<AuthToken>> _SavedTokenContainerLocator =
            RegisterContainerLocator<AuthToken>(
                "SavedToken",
                model =>
                    model._SavedToken =
                        model._SavedToken
                        ??
                        new PropertyContainer<AuthToken>("SavedToken"));
        #endregion







        [DataMember]
        public bool AutoLogin
        {
            get { return _AutoLoginContainerLocator(this).Value; }
            set { _AutoLoginContainerLocator(this).SetValueAndTryNotify(value); }
        }
        #region Property bool AutoLogin Setup
        protected PropertyContainer<bool> _AutoLogin;
        protected static Func<object, PropertyContainer<bool>> _AutoLoginContainerLocator =
            RegisterContainerLocator<bool>(
                "AutoLogin",
                model =>
                    model._AutoLogin =
                        model._AutoLogin
                        ??
                        new PropertyContainer<bool>("AutoLogin"));
        #endregion

        [DataMember]
        public string PhotoPath
        {
            get { return _PhotoPathContainerLocator(this).Value; }
            set { _PhotoPathContainerLocator(this).SetValueAndTryNotify(value); }
        }
        #region Property string PhotoPath Setup
        protected PropertyContainer<string> _PhotoPath;
        protected static Func<object, PropertyContainer<string>> _PhotoPathContainerLocator =
            RegisterContainerLocator<string>(
                "PhotoPath",
                model =>
                    model._PhotoPath =
                        model._PhotoPath
                        ??
                        new PropertyContainer<string>("PhotoPath"));
        #endregion











    }
}
